package cn.ecut.services;

import cn.ecut.dao.GoodDao;
import cn.ecut.model.Good;

import java.util.List;
import java.util.Objects;

public class GoodServices {
    private GoodDao goodDao = new GoodDao() ;
    public Good loadByGoodId(Integer goodId ) {
        Good good=  goodDao.loadByGoodId(goodId);
        return good;
    }
    public List<Good> loadByUserId(Integer userId ) {
        List<Good> goodList =  goodDao.loadByUserId(userId);
        return goodList;
    }
//    public List<Good> listTopGood(Integer num ){
//        List<Good> list = goodDao.listTop(num);
//        return list;
//    }
    public boolean saveGood(Good good){
        return goodDao.saveGood(good);
    }
    public boolean updateGoodState(Integer goodId) {
        return goodDao.updateGoodState(goodId);
    }

    public boolean deleteGood(Integer goodId) {
        return goodDao.deleteGood(goodId);
    }
}
